#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<math.h>
int main()
{
	int t[20],i,j,sum=0,temp;
	int max=0,min=100;
	double ave,standard_deviation=0;
	srand((int)time(NULL));
	printf("The number is:\n");
	for(i=0;i<20;i++)
	{
		//srand((int)time(NULL));
		t[i]=rand()%101;
		printf("%-4d",t[i]);
		sum+=t[i];
		if(t[i]>max)max=t[i];
		if(t[i]<min)min=t[i];
	}
	printf("\n\n");
	ave=(double)sum/20;
	for(i=0;i<20;i++)
	{
		standard_deviation+=pow((double)t[i]-ave,2);
	}
	standard_deviation=sqrt(standard_deviation/20);
	printf("max=%d\nmin=%d\nave=%g\nstandard deviation=%g\n",
		max,min,ave,standard_deviation);
	for(i=0;i<19;i++)
		for(j=0;j<19-i;j++)
		{
			if(t[j]>t[j+1])
			{temp=t[j];t[j]=t[j+1];t[j+1]=temp;}
		}	
	printf("\nsmall to big:\n");
	for(i=0;i<20;i++)
	{
		printf("%-4d",t[i]);
	}
	printf("\n");
	return 0;
}

